package day8;

import java.io.BufferedReader;
import java.io.FileReader;

/**
 * @author oldliu
 * @since 1.0
 */
public class BReaderTest2 {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new FileReader("D:\\Documents\\桌面\\rent-freely-master\\free-room\\README.txt"));
            String str = null;
            System.out.println("前五行:");
            for(int i=1;i<=5;i++){
                str=br.readLine();
                System.out.println(str);
            }
            System.out.println(br.markSupported());
            br.mark(32*1024);
            System.out.println("5行之后：");
            while ((str=br.readLine())!=null){
                System.out.println(str);
            }
            //reset，回到加标记的地方
            br.reset();
            System.out.println("回到上次的标记的地方：");
            while ((str=br.readLine())!=null){
                System.out.println(str);
            }
            br.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
